package com.blue.waffle.iwc.ui;

import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.blue.waffle.iwc.screens.AbstractScreen;
import com.blue.waffle.iwc.utils.SoundManager.IWCSound;

/**
 * A generic {@link ClickListener} class that by defaults plays the {@link IWCSound.TICK tick} sound.
 * @author Wenbin
 *
 */
public class ButtonActorListener extends ClickListener {

	protected AbstractScreen screen;
	private Object data;
	
	public ButtonActorListener(AbstractScreen screen){
		this.screen=screen;
	}
	
	public ButtonActorListener(AbstractScreen screen,Object data){
		this.screen=screen;
		this.data=data;
	}
	
	public Object getData() {
		return data;
	}
	
	@Override
	public void clicked(InputEvent event, float x, float y) {
		super.clicked(event, x, y);
		screen.getGame().getSoundManager().play(IWCSound.TICK);
	}
	
}
